home *** CD-ROM | disk | FTP | other *** search
- Path: sn.no!not-for-mail
- From: mobergru@oslonett.no (Rune Moberg)
- Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
- Subject: Re: C++ with Zapp vs. Delphi
- Date: 17 Jan 1996 04:27:52 +0100
- Organization: CD-Player Pro author!
- Message-ID: <WaE/w0JfFiKC089yn@oslonett.no>
- References: <4coar6$d4n@sun4.bham.ac.uk> <4coip7$69s@news1.usa.pipeline.com>
- <Eul+w0JfFyQD089yn@oslonett.no> <4dfnr9$4c02@tigger.cc.uic.edu>
- NNTP-Posting-Host: hasle.sn.no
- Mime-Version: 1.0
- Content-Type: text/plain; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
-
- In article <4dfnr9$4c02@tigger.cc.uic.edu>,
- olczyk@sunphy1 (Thadeus Olczyk) wrote:
- >Unfortunately it was late two hours ago.
- >I will follow up more thoroughy later but there were two parts I couldn't
- >resist.
-
- Thought as much... :-)
-
- >Rune Moberg (mobergru@oslonett.no) wrote:
- >: typedef int (*CFT) (void*,void*);
- >: void sort(void* base, unsigned n, unsigned int sz, CFT cmp)"
- >: (don't worry, the n-key wasn't sticky after all, so typing went ahead
- >: at full speed. Bjarne mentions MI a couple of places (4), but not as
- >: a requirement for polymorphism)
- >
- >: Now, I have some C experience (half a year), but the above is totally
- >If you can't read the above then your half year of experience was rather
- >poor. Unfortunately the biggest fraud in the computer world are the shelves
-
- Ok. What I meant to say, was:
- "Now, I have some C experience (half a year), but the above is something
- I no longer automatically recognise"
-
- Anyway, without looking in any books, this is what I deciphered:
-
- void (ah, a function returning nothing - aka procedure in Pascal)
- sort (the function name)
- void* base (uhm... An undefined pointer?)
- unsigned n (probably an unsigned integer - aka word in Pascal)
- unsigned int sz (definatively an unsigned integer)
- CFT cmp (right, a variable of type CFT declared above)
-
- typedef int (*CFT) (void*,void*);
- is what got me. What is this? Could it be a typedeclaring a function
- returning an int, with two undefined arguments (pointers)? It would
- probably deserve a comment (or three), or one could write it in Pascal.
-
- >: (Sender as TEdit).CutToClipboard;
- >: will work for TEdit and all descendants of TEdit, but will generate an
- >: exception for any other object.
- >
- >: Object Pascal has a different type cast (also available in Delphi) that
- >: instead of generating an exception will most probably crash (AFAIK):
- >: TEdit(Sender).CutToClipboard; {a somewhat more direct approach}
- >For an event this is fine. But for a method it's not. A method won't know
-
- An event is just another method, handling all TObject descendants
- (through the Sender parameter of type TObject)?
-
- --
- =\
- *=- R.Moberg, CD-Player Pro info @ http://www.sn.no/~mobergru/
- =/
-